package com.demiroot.server;

import java.io.InputStream;
import java.io.OutputStream;


/**
 * The poorly thoughtout magic proxy intercept.
 * These methods are called as a proxyrequest
 * is coming through to control the flow of things  
 *  
 * @author Sean Oczkowski
 *
 */

public interface ProxyIntercept {
	
	/**
	 * The outgoing request to modify.
	 */
	public HTTPResquest modifyOutgoingRequest(HTTPResquest request);
	
	/**
	 * The incoming headerdata if you want to modify it. Return null 
	 * if you want to tack you own header data onto the stream manually
	 * in the modifyContents step.
	 */
	public HeaderData modifyReturningHeader(HeaderData head);
	
	/**
	 * The two streams of content. There is stuff in the "in" stream
	 * and you need to put stuff in the out stream for people to see
	 * in the browser. It would be nice if they were related, but do 
	 * whatever makes you happy.  
	 */
	public void modifiyContents(InputStream is, OutputStream os);
}
